<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">


<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>




<html>
<head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'></head>
<body>
<div class="container " style="height: 800px ;width: 500px" >

    <form th:action="@{/dologin}" method="post">
        <h2>登录</h2>
        <div class="form-group">
            <label for="account">管理员账号</label>
            <input type="text" class="form-control" name="account" id="account" placeholder="管理员账号">
        </div>
        <div class="form-group">
            <label for="password">管理员密码</label>
            <input type="password" class="form-control" name="password" id="password" placeholder="管理员密码">
        </div>

        <button type="submit" class="btn btn-default" >登录</button>
        <a class="btn btn-default" th:href="@{/register}">注册</a>

    </form>
    <span style="color: red">[[${error}]]</span>
    <span style="color: red">[[${error1}]]</span>

</div>
</body>
</html>

<script>
    let url = window.location.href;//http://localhost:3000/edu/edu_teacher?type=2&a=3
    if(url.indexOf('?') != -1){
        let obj = [];
        let arr = url.slice(url.indexOf('?')+1).split('&');
        arr.forEach(item => {
            let param = item.split('=');
            obj[param[0]] = param[1];
        })
        console.log(obj);//{type: "2", a: "3"}
        alert(decodeURIComponent(obj.success));

    }
</script>




